class: center, middle, inverse, title-slide # Advice on finding international datasets --- layout: true <div class="dk-footer"> <span> <a href="https://rfortherestofus.com/" target="_blank">R for the Rest of Us </a> </span> </div> --- class: center, middle, dk-section-title background-image:url("images/united-nations.jpeg") background-size: 100% # Advice on finding international datasets ??? --- # What kind of geoboundary do you need? <img src='images/3-types-of-borders.png' width='100%'/> ??? --- ### Country borders: `{rnaturalearthdata}` .pull-left[ ```r library("rnaturalearthdata") countries110 %>% st_as_sf() %>% select(name, continent) %>% mapview() ``` - It's available on CRAN - It's quick and easy to use ] .pull-right[
] ??? --- ### Country borders: `{rnaturalearthdata}` .pull-left[ There are two datasets included: - `countries110`: scale of 1:110m - `countries50`: scale of 1:50m ] .pull-right[ <img src="data:image/png;base64,#01_11_advice-on-finding-international-datasets_files/figure-html/gg-uk-110-1.png" width="80%" /> ] ??? --- ### `{rnaturalearthhires}` 1:10m country shapefiles are too large to fit in a CRAN package. ```r remotes::install_github("ropensci/rnaturalearthhires") ``` <center> <img src="data:image/png;base64,#01_11_advice-on-finding-international-datasets_files/figure-html/unnamed-chunk-7-1.png" height="350px" /> </center> ??? --- ## Administrative divisions .pull-left[ Administrative divisions are standardised hierarchical country subdivisions as defined in ISO 3166-2. There are [more than 30 different national subdivision names](https://en.wikipedia.org/wiki/Administrative_division#Examples_of_administrative_divisions). ] .pull-right[ <img src='images/gg_administrative-regions.png'/> ] ??? --- ### Administrative divisions: territories .pull-left[ Administrative divisions names are often non-uniform at multiple levels. This is an artefact of colonialism. This can complicate data analysis and visualisation. ] .pull-right[ <img src='images/french-administrative-divisions.png' width='100%'/> ] ??? --- ### Administrative divisions: what are they good for? .pull-left[ Administrative divisions are used for different things in different countries. ] .pull-right[ These might include: - Local governmental authorities - Regional collections of local authorities - Electoral regions - Postal regions ] ??? --- ### Administrative divisions: `raster::getData()` `raster::getData()` provides access to all available administrative divisions from the GADM dataset. <hr> .pull-left[ Load the `{raster}` package **before** loading the `{tidyverse}` ```r library("raster") library("tidyverse") ``` ] .pull-right[ <img src='images/raster-tidyverse-load-order.png'/> ] ??? --- ### RStudio Coding Slide: ??? --- ## Other subunits .pull-left[ You'll often find maps you want to make require other country subunits. ] .pull-right[ <!-- --> ] ??? --- ### Census Offices / Statistics Offices Often shapefiles can be found in a natianal Census Office or in a Statistics Office. There are two good sources for these offices: - Wikipedia's [list of National & International Statistical Services](https://en.wikipedia.org/wiki/List_of_national_and_international_statistical_services). - The UN's Statistical Division [list of national statistics offices](https://unstats.un.org/home/nso_sites/) ??? --- ### Country and local authority data portals [DataPortals.org](https://dataportals.org/search) claims to be the most comprehensive list of **Open Data** portals - with 590+ portals listed. ??? --- ## Geoboundaries change over time All of the boundaries that we've discussed are liable to change (potentially drastically) over time. - `{rnaturalearthdata}` is expected to keep up to date with changes on the [naturalearthdata.com]() service. - `raster::getData()` connects to GADM which is actively kept up to date - You're responsible for finding up-to-date (or historical!) data for other subunits. ???